//
//  FunnyModel.m
//  HaHa
//
//  Created by lanou3g on 15/9/18.
//  Copyright (c) 2015年 吉亚平. All rights reserved.
//

#import "FunnyModel.h"
@class FunnyTableViewCell;
@implementation FunnyModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

+ (FunnyModel *)SetModeWithDIC:(NSDictionary *)Dic{
    FunnyModel *mode = [[FunnyModel alloc] init];
    mode.comments = [Dic objectForKey:@"comments"];
    mode.comments = [Dic objectForKey:@"comments"];
    NSString *str = [Dic objectForKey:@"display_time"];
    mode.display_time = [mode Retrun:str];
    NSDictionary *DataDIC = [Dic objectForKey:@"group"];
    
    [mode setValuesForKeysWithDictionary:DataDIC];
    NSString *temp = [DataDIC objectForKey:@"create_time"];
    mode.cretatime = [mode Retrun:temp];


    return mode;
}

- (NSString *)Retrun:(NSString *)str{
    
    NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
    formatter.timeZone = [NSTimeZone timeZoneWithName:@"shanghai"];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"MM-dd HH:mm"];
    NSDate* date = [NSDate dateWithTimeIntervalSince1970:[str doubleValue]];
    NSString* dateString = [formatter stringFromDate:date];
    return dateString;
}
@end
